﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace WebMiddleware.Views
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window, IMainWindow
    {
        private readonly ITaskProxy _proxy;

        public MainWindow(ITaskProxy proxy)
        {
            _proxy = proxy;
            InitializeComponent();
        }

        public async Task CloseAsync()
        {
            await _proxy.InvokeAsync(() =>
            {
                this.Close();
            });
        }

        public async Task HideAsync()
        {
            await _proxy.InvokeAsync(() =>
            {
                this.Hide();
            });
        }

        public async Task ShowAsync()
        {
            await _proxy.InvokeAsync(() =>
            {
                this.Show();
            });
        }
    }
}
